import {
  HomeFilled,
  FundFilled,
  AppstoreFilled,
  BulbFilled,
} from "@ant-design/icons";
import { lazy } from "react";
import { redirect } from "react-router-dom";

export const BigRouters = [
  {
    path: "/home/index",
    element: lazy(() => import("@/pages/Homes/Index")),
    title: "首页",
    icon: <HomeFilled />,
  },
  {
    path: "/home/dp",
    element: lazy(() => import("@/pages/Homes/Dp")),
    title: "大屏管理",
    icon: <FundFilled />,
    children: [
      {
        path: "/home/dp/emp",
        element: lazy(() => import("@/pages/Homes/dp/Employment")),
        title: "就业态势",
        icon: <AppstoreFilled />,
      },
      {
        path: "/home/dp/int",
        element: lazy(() => import("@/pages/Homes/dp/Intellect")),
        title: "智能检测",
        icon: <AppstoreFilled />,
      },
      {
        path: "/home/dp/sec",
        element: lazy(() => import("@/pages/Homes/dp/Security")),
        title: "安防管理",
        icon: <AppstoreFilled />,
      },
      {
        path: "/home/dp/fac",
        element: lazy(() => import("@/pages/Homes/dp/Facility")),
        title: "设备运维",
        icon: <AppstoreFilled />,
      },
    ],
  },
  {
    path: "/home/kno",
    element: lazy(() => import("@/pages/Homes/Knowledge")),
    title: "知识点",
    icon: <BulbFilled />,
  },
];

const routers = [
  {
    path: "/",
    to:"/login"
  },
  {
    path: "/home",
    element: lazy(() => import("@/pages/Home")),
    title: "首页",
    children: BigRouters,
  },
  {
    path: "/login",
    element: lazy(() => import("@/pages/Login")),
    title: "登录",
  },
  {
    path: "*",
    element: lazy(() => import("@/pages/Error")),
    title: "错误页",
  },
];

export default routers;
